package com.cwl.mc.handler;

import com.alibaba.fastjson.JSONObject;
import com.cwl.common.dto.UEResult;
import com.cwl.common.exception.UEException;
import com.cwl.model.mc.UeMchInfo;
import org.springframework.stereotype.Service;

/**
 * 商户基本信息
 *
 * @author cwivan
 * @version 1.0
 * @date 2019/3/12
 */

@Service("MchInfo")
public class MchInfo extends McBaseHandler implements IMcHandler {
	@Override
	public UEResult handler(JSONObject params) throws UEException {
		String mchNo = params.getString("mchNo");

		UeMchInfo mchInfo = UeMchInfo.DAO.findById(mchNo);


		if(mchInfo == null){
			return UEResult.error("该商户不存在");
		}

		JSONObject result = new JSONObject();
		result.put("mchInfo", mchInfo);
		return UEResult.success(result);
	}
}
